<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<style>
    @keyframes lmh{
        0%{
            background: white;
            margin-left: 100px;
        }
        50%{
            background: black;
            margin-left: 100px;
        }
         /* 100%{
            background: white;
            margin-left: 0px; 
        } */
        from{
            background: white;
            margin-left: 0px;
        }
        to{
            background: black;
            margin-left: 100px;
        }
    }
    div{
        width: 200px;
        height: 200px;
        background: white;
        border: 1px solid green;
        animation-name: lmh;
        animation-duration: 1s;
        animation-timing-function: ease-in;
        animation-delay: 1s;
        animation-iteration-count: 2;
        animation-direction: alternate;
        /* animation-play-state: paused; */
        animation-fill-mode: forwards;
        animation-iteration-count: 4;
        animation-direction: alternate;
    }
</style>
<body>
    <div>我是html2</div>
</body>
</html>